package cn.itqiqi.factorybean;

import cn.itqiqi.pojo.Course;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author kevin_琪琪
 * @version 1.0
 * @description
 * @date 2022-06-08 16:47
 */

public class MyBean implements FactoryBean<Course> {

    // 定义返回的bean
    @Override
    public Course getObject() throws Exception {
        Course course = new Course();
        course.setCname("JAVA课程");
        return course;
    }

    // 获取对象类型
    @Override
    public Class<?> getObjectType() {
        return Course.class;
    }

    // 是否单例模式
    @Override
    public boolean isSingleton() {
        return FactoryBean.super.isSingleton();
    }
}
